package de.pass.ch.pt;

public class StreetProfile extends IStreetProfile {

	private boolean streetFactorMode;
	private short speedHighway;
	private short speedFederalRoad;
	private short speedCountryRoad;
	private short speedRegionalRoad;
	private short speedTownRoad;
	private short speedHighwayTown;
	private short speedFederalRoadTown;
	private short speedCountryRoadTown;
	private short speedCountryLane;
	private short speedPedestrArea;

	/**
	 * Konstruktor für die Standard-Werte aus Plantour
	 */
	public StreetProfile() {
		this(true, (short) 80, (short) 80, (short) 70, (short) 70, (short) 50,
				(short) 80, (short) 50, (short) 50, (short) 15, (short) 10);
	}

	/**
	 * Erzeugt ein neues Straßenprofil mit den angegebenen Werten.
	 * 
	 * @param factorMode
	 * @param highway
	 * @param federalRoad
	 * @param countryRoad
	 * @param regionalRoad
	 * @param townRoad
	 * @param highwayTown
	 * @param federalRoadTown
	 * @param countryRoadTown
	 * @param countryLane
	 * @param pedestrArea
	 */
	public StreetProfile(boolean factorMode, short highway,
			short federalRoad, short countryRoad, short regionalRoad,
			short townRoad, short highwayTown, short federalRoadTown,
			short countryRoadTown, short countryLane, short pedestrArea) {

		streetFactorMode = factorMode;
		speedHighway = highway;
		speedFederalRoad = federalRoad;
		speedCountryRoad = countryRoad;
		speedRegionalRoad = regionalRoad;
		speedTownRoad = townRoad;
		speedHighwayTown = highwayTown;
		speedFederalRoadTown = federalRoadTown;
		speedCountryRoadTown = countryRoadTown;
		speedCountryLane = countryLane;
		speedPedestrArea = pedestrArea;

	}

	@Override
	public boolean getStreetFactorMode() {
		return streetFactorMode;
	}

	@Override
	public short getSpeedHighway() {
		return speedHighway;
	}

	@Override
	public short getSpeedFederalRoad() {
		return speedFederalRoad;
	}

	@Override
	public short getSpeedCountryRoad() {
		return speedCountryRoad;
	}

	@Override
	public short getSpeedRegionalRoad() {
		return speedRegionalRoad;
	}

	@Override
	public short getSpeedTownRoad() {
		return speedTownRoad;
	}

	@Override
	public short getSpeedHighwayTown() {
		return speedHighwayTown;
	}

	@Override
	public short getSpeedFederalRoadTown() {
		return speedFederalRoadTown;
	}

	@Override
	public short getSpeedCountryRoadTown() {
		return speedCountryRoadTown;
	}

	@Override
	public short getSpeedCountrylane() {
		return speedCountryLane;
	}

	@Override
	public short getSpeedPedestrianArea() {
		return speedPedestrArea;
	}

	public static StreetProfile getInstance(int type) {
		switch (type) {
		case FAST_PROFILE:
			return new StreetProfile(true, (short) 130, (short) 60,
					(short) 60, (short) 60, (short) 40, (short) 120,
					(short) 50, (short) 50, (short) 1, (short) 20);
		case UNIFORMITY_PROFILE:
			return new StreetProfile(true, (short) 80, (short) 80,
					(short) 80, (short) 80, (short) 80, (short) 80, (short) 80,
					(short) 80, (short) 80, (short) 80);
		default:
			return new StreetProfile();
		}
	}

	public static final int DEFAULT_PROFILE = 1;
	public static final int FAST_PROFILE = 2;
	public static final int UNIFORMITY_PROFILE = 3;

}
